package com.fanfan.SmartPensionSystembackend.service.impl;

import com.fanfan.SmartPensionSystembackend.entity.Payment;
import com.fanfan.SmartPensionSystembackend.mapper.PaymentMapper;
import com.fanfan.SmartPensionSystembackend.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Description PaymentServiceImpl
 * @Author Guangdi Chen
 * @Date 2025-03-30
 */
@Service
public class PaymentServiceImpl implements PaymentService {
    @Autowired
    private PaymentMapper paymentMapper;

    // 获取所有老人信息
    @Override
    public List<Payment> getAllElderInfo() {
        return paymentMapper.getAllElderInfo();
    }

    // 根据老人ID获取老人信息
    @Override
    public Payment getElderInfoByElderId(String elderId) {
        return paymentMapper.getElderInfoById(elderId);
    }

    // 一键插入所有老人的月固定费用
    @Override
    public int pushAllFixedCost(Map<String, Double> fixationFeeInfo) {
        return paymentMapper.pushAllFixedCost(fixationFeeInfo);
    }

    // 插入或更新特殊费用
    @Override
    public int insertOrUpdateSpecialCost(Map<String, Object> specialCostInfo) {
        return paymentMapper.insertOrUpdateSpecialCost(specialCostInfo);
    }
}